//
//  MyTapBiHeaderView.m
//  VEMoneyPorject
//
//  Created by 陈建 on 2018/9/28.
//  Copyright © 2018年 陈建. All rights reserved.
//

#import "MyTapBiHeaderView.h"

@implementation MyTapBiHeaderView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self setupSubViews];
    }
    return self;
}

- (void)setupSubViews{
    UIView *topView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 40)];
    topView.backgroundColor = kWhiteColor;
    [self addSubview:topView];
    CGFloat LabW = kScreenWidth/3.0;
    for (NSInteger i = 0; i< 3; i++) {
        UILabel *lab = [[UILabel alloc] init];
        [topView addSubview:lab];
        lab.textColor = [UIColor colorWithHexString:kNomalTextBlackColor];
        lab.font = kFont(16.f);
        lab.textAlignment = NSTextAlignmentCenter;
        lab.text = [self titleArray][i];
        [lab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(topView).offset(i*LabW);
            make.top.bottom.equalTo(topView);
            make.height.equalTo(@40);
            make.width.equalTo(@(LabW));
        }];
    }
    UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(topView.frame), kScreenWidth, 10)];
    bottomView.backgroundColor = [UIColor colorWithHexString:kCommonBgColor];
    [self addSubview:bottomView];
}

- (NSArray *)titleArray{
    return @[@"等级",@"日复利",@"周期"];
}

@end
